package com.ies.ieschool.client.module.academic.view.data;

import com.ies.ieschool.client.module.academic.dto.CourseListGridDTO;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.data.fields.DataSourceBooleanField;
import com.smartgwt.client.data.fields.DataSourceIntegerField;
import com.smartgwt.client.data.fields.DataSourceTextField;

public class ClassData extends DataSource {
	
	private static ClassData instance = null;  
	  
    public static ClassData getInstance() {  
        if (instance == null) {  
            instance = new ClassData("classDS");  
        }  
        return instance;  
    }
    
    public ClassData(String id) {  
  	  
        setID(id);  
        setRecordXPath("/List/class");  
        DataSourceIntegerField pkField = new DataSourceIntegerField("pk");  
        pkField.setHidden(true);  
        pkField.setPrimaryKey(true);  
  
        DataSourceTextField classNameField = new DataSourceTextField("className");  
        classNameField.setRequired(true);  
  
        DataSourceTextField classAmountField = new DataSourceTextField("classAmount");  
        classAmountField.setRequired(true);  
  
        DataSourceTextField teacherField = new DataSourceTextField("teacher");  
        teacherField.setRequired(true);  
          
        setFields(pkField, classNameField, classAmountField, teacherField);  
  
        setDataURL("ds/test_data/class.data.xml");  
        setClientOnly(true);  
    }

}
